using System.Collections.Generic;
using IdentityServer4.Models;

namespace Idp_Login
{
    public partial class Config_ApiScopes_Demo
    {
        //定义API资源
        public static IEnumerable<ApiScope> GetApiScopes()
        {
            //可访问的API资源(资源名，资源描述,这个资源需要的claims)
            var apis = new List<ApiScope>();

            {
                var api = new ApiScope("TimerA1", "TimerA1 ApiScope");
                api.UserClaims = new List<string>()
                {
                    //ClaimConst.UserId,
                    IdentityModel.JwtClaimTypes.Role,
                    IdentityModel.JwtClaimTypes.NickName,
                    "eMail"
                };
                apis.Add(api);
            }

            {
                var api = new ApiScope("BackA1", "BackA1 ApiScope");
                api.UserClaims = new List<string>()
                {
                    //ClaimConst.UserId,
                    IdentityModel.JwtClaimTypes.Role,
                    IdentityModel.JwtClaimTypes.NickName,
                    "eMail"
                };
                apis.Add(api);
            }

            {
                var api = new ApiScope("BackA2", "BackA2 ApiScope");
                api.UserClaims = new List<string>()
                {
                    //ClaimConst.UserId,
                    IdentityModel.JwtClaimTypes.Role,
                    IdentityModel.JwtClaimTypes.NickName,
                    "eMail"
                };
                apis.Add(api);
            }
            return apis;

        }
    }
}
